Skip to main content
Glama

Example Next.js MCP Server

by RMTRQ
MIT License
route.ts622 B
import { createMcpHandler } from "@vercel/mcp-adapter"; import { z } from "zod"; const handler = createMcpHandler( async (server) => { server.tool( "echo", "description", { message: z.string(), }, async ({ message }) => ({ content: [{ type: "text", text: `Tool echo: ${message}` }], }) ); }, { capabilities: { tools: { echo: { description: "Echo a message", }, }, }, }, { basePath: "", verboseLogs: true, maxDuration: 60, } ); export { handler as GET, handler as POST, handler as DELETE };

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/RMTRQ/model-context-protocol-mcp-with-next-js'

If you have feedback or need assistance with the MCP directory API, please join our Discord server